From c0e85ece47f9ef2bce69650a9854fe2a1ea7fb6a Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Fri, 31 Aug 2007 11:10:21 +0100 Subject: [PATCH] Fix blktap script for versions of readlink command that do not handle regular files. Signed-off-by: Ben Guthro Signed-off-by: Josh Nicholas --- tools/examples/blktap | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/examples/blktap b/tools/examples/blktap index e4ac40b331..b3a0b63544 100644 --- a/tools/examples/blktap +++ b/tools/examples/blktap @@ -69,7 +69,13 @@ then p=${p#*:} fi fi -file=$(readlink -f "$p") || ebusy "$p does not exist." +# some versions of readlink cannot be passed a regular file +if [ -L "$p" ]; then + file=$(readlink -f "$p") || ebusy "$p link does not exist." +else + [ -f "$p" ] || { ebusy "$p file does not exist." } + file="$p" +fi if [ "$mode" != '!' ] then -- 2.30.2